package com.example.smartcitymovie.adapter;

import android.widget.ImageView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;
import com.example.smartcitymovie.R;
import com.example.smartcitymovie.utils.OkHttpUtils;

/**
 * @Author: Machu
 * @Time: 2022/2/14 13:27
 * @Description: 功能描述
 */
public class ImageViewHolder {
    @BindingAdapter("imageUrl")
    public static void LoadImage(ImageView imageView,Object url){
        if (url instanceof String){
            Glide.with(imageView).load(url).placeholder(R.drawable.ic_baseline_broken_image_24).into(imageView);
        }else{
            imageView.setImageResource((Integer) url);
        }
    }
}
